package com.wsd.smartcarwasher.controller;


import com.wsd.smartcarwasher.service.RedisService;
import com.wsd.smartcarwasher.service.SMSService;
import com.wsd.smartcarwasher.util.ReturnUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Api(tags = "发送短信")
@Controller
@CrossOrigin
public class SMSController {

    @Resource
    private SMSService smsService;
    @RequiresPermissions("sys:menu:remove")
    @ApiOperation(
            value = "测试短息服务 ",
            notes = "测试短息服务",
            produces = "application/json",
            response = ModelMap.class
    )
    @ApiImplicitParam(
            name = "code",
            value = "code",
            required = false,
            dataType = "String"
    )
    @RequestMapping(
            value = {"/v1/sms/send"},
            method = {RequestMethod.GET},
            produces = {"application/json; charset=utf-8"}
    )
    @ResponseBody
    public ModelMap getSessionKey() {

        smsService.sendCardMSG("18702988980","好运来","2020-03-06 22:22:22",20);
        smsService.sendCouponMSG("18702988980","一张","2020-03-06 22:22:22");
        return ReturnUtil.Success("发送成功");

    }


}
